package com.hzpd.hainan.module.news.adapter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.hzpd.hainan.R;
import com.hzpd.hainan.app.ListBaseAdapter;
import com.hzpd.hainan.model.news.NewsTagBean;
import com.hzpd.hainan.utils.LogUtils;
import com.hzpd.hainan.utils.ViewHolder;

public class NewsCancelGridAdapter extends ListBaseAdapter<NewsTagBean> {
	
	private Activity activity;
	
	public NewsCancelGridAdapter(Activity activity) {
		super(activity);		
		this.activity = activity;
	}

	@Override
	public void appendData(List<NewsTagBean> data, boolean isClearOld) {
		super.appendData(data, isClearOld);
	}

	@Override
	public int getCount() {
		
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		
		return position;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		final int p = position;
		final NewsTagBean ntb = list.get(position);
		if (convertView == null) {
			convertView = LayoutInflater.from(context).inflate(R.layout.news_cancel_grid_item, parent,false);
		}
		final TextView tv = ViewHolder.get(convertView, R.id.news_cancel_griditem_tv);
		tv.setText(ntb.getTagname());
		LogUtils.i("adapter item hight-->"+ convertView.getMeasuredHeight());
					
		return convertView;
	}

	@Override
	public View getMyView(int position, View convertView, ViewGroup parent) {		
		return null;
	}

}
